package com.jic.interaction.hereWeGo.controller;

import com.alibaba.fastjson.JSONObject;
import com.jic.common.base.vo.RestResult;
import com.jic.interaction.hereWeGo.model.entity.Overbooking;
import com.jic.interaction.hereWeGo.model.vo.request.OverbookingRequset;
import com.jic.interaction.hereWeGo.model.vo.response.OverbookingResponse;
import com.jic.interaction.hereWeGo.service.OverbookingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.concurrent.ExecutionException;

@RestController
@Slf4j
@RequestMapping("mall/order/{account}")
@Api(tags = " [下单接口]")
public class OverbookingController {

    @Resource
    private OverbookingService overbookingService;

    @PostMapping("/buy")
    @ApiOperation(value = "下单返回")
    @ResponseBody
   public RestResult<JSONObject> overbookingBuy(@RequestBody OverbookingRequset overbookingRequset) throws Exception {

        return overbookingService.overbookingBuy(overbookingRequset);
    }

}
